package org.nepu.scr.indexrate.ratelongevity;

import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nepu.scr.indexrate.ratelongevity.longevity.params.LongevityData;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@AllArgsConstructor
public class LongevityDataService {
    @SneakyThrows
    public void setData (LongevityData data, String result, String target){
        switch (target) {
            case "C": data.setC(result);break;
            case "C1": data.setC1(result);break;
            case "C2": data.setC2(result);break;
            case "C3": data.setC3(result);break;
            case "C4": data.setC4(result);break;
            case "C5": data.setC5(result);break;
            case "C11": data.setC11(result);break;
            case "C12": data.setC12(result);break;
            case "C13": data.setC13(result);break;
            case "C21": data.setC21(result);break;
            case "C22": data.setC22(result);break;
            case "C23": data.setC23(result);break;
            case "C31": data.setC31(result);break;
            case "C32": data.setC32(result);break;
            case "C41": data.setC41(result);break;
            case "C51": data.setC51(result);break;
            case "C52": data.setC52(result);break;
            default: break;
        }
    }
}
